package com.zts.modules.sys.entity.model;

/**
 * Created by jisd on 2017/6/16.
 */

import com.zts.base.entity.EntityModel;
import com.zts.modules.sys.entity.Resource;
import com.zts.util.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.BeanUtils;


public class ResourceModel extends EntityModel<Resource> {
    @ApiModelProperty("资源的名称")
    private String resourceName;
    @ApiModelProperty("父亲组")
    private Long parentId;
    @ApiModelProperty("资源属性")
    private String resourceValue;
    @ApiModelProperty("资源类型")
    private String type;
    @ApiModelProperty("资源序号排序")
    private Long sortNum;
    private String status;
    private String resourceCode;

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getResourceValue() {
        return resourceValue;
    }

    public void setResourceValue(String resourceValue) {
        this.resourceValue = resourceValue;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getSortNum() {
        return sortNum;
    }

    public void setSortNum(Long sortNum) {
        this.sortNum = sortNum;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getResourceCode() {
        return resourceCode;
    }

    public void setResourceCode(String resourceCode) {
        this.resourceCode = resourceCode;
    }

    public Resource transEntity() {
        Resource resource = new Resource();
        String[] emptyProperties = BeanUtil.getNullPropertyNames(this);
        BeanUtils.copyProperties(this, resource, emptyProperties);
        return resource;
    }

    public Resource transEntity(Resource resource) {
        String[] emptyProperties = BeanUtil.getNullPropertyNames(this);
        BeanUtils.copyProperties(this, resource, emptyProperties);
        return resource;
    }
}

